﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BE;
using DAL;
using BE.SearchCriteria;

namespace BLL
{
    public class CalleBLL : BaseBLL
    {
        public static List<CalleBE> SeleccionarTodos(BaseSC pCalleSC, int pPageSize, int? pPageNum, ref int pCountReg)
        {
            CalleDAL oCalleDAL = new CalleDAL();
            return oCalleDAL.SeleccionarPorParametros(pCalleSC, pPageSize, pPageNum, ref pCountReg);
        }

        public static CalleBE SeleccionarPorId(CalleBE oCalleBE)
        {
            CalleDAL oCalleDAL = new CalleDAL();
            return oCalleDAL.SeleccionarPorId(oCalleBE);
        }

        public static void InsertarCalle(CalleBE pCalle)
        {
            CalleDAL oCalleDAL = new CalleDAL();
            oCalleDAL.Insertar(pCalle);
        }

        public static void Modificar(CalleBE pCalle)
        {
            CalleDAL oCalleDAL = new CalleDAL();
            oCalleDAL.Modificar(pCalle);
        }

        public static void Eliminar(CalleBE pCalle)
        {
            try
            {
                CalleDAL oCalleDAL = new CalleDAL();
                oCalleDAL.Delete(pCalle);
            }
            catch (Exception ex)
            {
                if (!HandleException(ex))
                    throw;
            }

        }
    }
}
